package org.springframework.validation.executors;


/**
 * Asserts a value is valid if it is empty, or matches a given regex.
 * @author cduplichien
 *
 */
public abstract class RegexMatchRuleExecutor extends ValidWhenEmptyRuleExecutor {

	public boolean doValidate(Object model, Object argument) {
		return  String.valueOf(model).matches(getRegularExpression());
	}
	
	public abstract String getRegularExpression();

}
